#ifndef VROUTE_PORT_MANAGER_HPP_3
#define VROUTE_PORT_MANAGER_HPP_3

#include "vroute_stack.hpp"
#include "vroute_IFServerdef.hpp"

namespace vroute_stack
{
    class portListMgr;
    class CPortMgr
    {
    public:
        static CPortMgr* getInstance();
        static void releaseInstnce();

        CPortMgr();
        ~CPortMgr();

        int init(SystemStartType type);      

        int getOepnPortCount();

        int getValue(unsigned char socketIndex, portItemKey key, void*& value);
        int setValue(unsigned char socketIndex, portItemKey key, const void* value);

        int getOutPutPort(unsigned char socketIndex, unsigned char& outIndex);
        int getOutputPortAddr(const Node& nextaddr, unsigned char& outIndex);
        int getOutPutPortByInIndex(unsigned char inIndex, unsigned char& outIndex);

        int canclePort(int socketIndex);
    private:
        static CPortMgr* _instance;
        portListMgr* m_port;
    };
}
#endif //VROUTE_PORT_MANAGER_HPP_3